package com.ky.manage.adapter;

import android.content.Context;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.ky.manage.R;
import com.ky.manage.activity.web.OutletsResp;

import java.util.List;

import androidx.annotation.NonNull;
import me.zhanghai.android.materialratingbar.MaterialRatingBar;

public class OutletsAdapter extends BaseQuickAdapter<OutletsResp.RowsDTO, BaseViewHolder> {

    List<OutletsResp.RowsDTO> list;
    Context context;

    public OutletsAdapter(int layoutResId) {
        super(layoutResId);
    }

    public OutletsAdapter(Context context, int layoutResId, List<OutletsResp.RowsDTO> list) {
        super(layoutResId, list);
        this.list = list;
        this.context = context;
    }

    @Override
    protected void convert(@NonNull BaseViewHolder baseViewHolder, OutletsResp.RowsDTO rowsDTO) {
        TextView pointName = baseViewHolder.findView(R.id.tv_netPoint_name);
        TextView juli = baseViewHolder.findView(R.id.tv_distance);
        MaterialRatingBar ratingBar = baseViewHolder.findView(R.id.normal_ratingbar);
        TextView sellCount = baseViewHolder.findView(R.id.tv_sell_count);
        TextView scpoe = baseViewHolder.findView(R.id.tv_business_scope);
        TextView address = baseViewHolder.findView(R.id.tv_netpoint_address);

        pointName.setText(rowsDTO.getBusinessOutletsName());
        ratingBar.setRating(5);
        sellCount.setText("999+");
        scpoe.setText(rowsDTO.getBusinessScope());
        address.setText(rowsDTO.getAddress());
    }
}
